using UnityEngine;
using System;
using System.Collections.Generic;

public class Player : MonoBehaviour {
	
	#region Fields	
	int rank; // player's rank
	public String playerName; // player character's name
	int hospital; // the hospital the player plays in
	int currentExp; // how many experience points does the player have
	int level; // player's current level
	int cash; // player's current cash
	int budgetPoints; // how many actions can the player take aka the amount of budget points
	bool isDoctor; // is this a doctor or a nurse?
	GameObject levelUI;
	GameObject notEnoughBP;
	#endregion
	
	#region Set Up
	void Awake()
	{
		rank = 1;
		currentExp = 0;
		level = 1;
		cash = 0;
		budgetPoints = Constants.STARTING_BP;
		notEnoughBP = GameObject.Find("Not Enough Points Indicator");
		notEnoughBP.guiText.enabled = false;
	}
	#endregion
	
	#region Getters and Setters
	public int getLevel()
	{
		return level;	
	}
	
	public void setLevel(int newLevel)
	{
		level = newLevel;	
	}
	
	public int getBudgetPoints()
	{
		return budgetPoints;	
	}
	
	public void setBudgetPoints(int newBudgetPoints)
	{
		budgetPoints = newBudgetPoints;	
	}
	#endregion
	
	#region Methods
	void Update()
	{
		
	}
	
	public void subtractBudgetPoints(int amount)
	{
		if (budgetPoints - amount >= 0)
		{
			budgetPoints -= amount;	
			notEnoughBP.guiText.enabled = false;
		}
		else
		{
			notEnoughBP.guiText.enabled = true;
			return;
		}
	}
	
	
	public bool updateGame(int ans,int input){
		if(ans==input){
			subtractBudgetPoints(1);
			return true;
		}else{
			subtractBudgetPoints(2);
			return false;
		}
	}
	#endregion
	
}
